package answercard;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.awt.image.Raster;
import java.io.File;

/**
 * @author chenkn
 * since 2018/12/14
 */
public class BufferedImageTest {

    public static void main(String[] args) throws Exception {
        String src = "D:\\eclipse_wk\\opencv-master\\img\\a5.jpg";
        BufferedImage bufferedImage = ImageIO.read(new File(src));
        int width = bufferedImage.getWidth();
        System.out.println("width = " + width);
        int height = bufferedImage.getHeight();
        System.out.println("height = " + height);

        Raster raster = bufferedImage.getData();
        int x = raster.getMinX();
        System.out.println("x = " + x);
        int y = raster.getMinY();
        System.out.println("y = " + y);

    }
}
